package com.ymatou.app.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.parameter.ProductDetailBean;
import com.ymatou.app.service.ProductDetailCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;

public class Ts_ProductDetail {
	
	private static ProductDetailCall detailCall = null;
	private static ProductDetailBean detailBean = null;
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取商品详情接口");
	}

	@Before
	public void caseUp() {
		detailCall = new ProductDetailCall();
		detailBean = new ProductDetailBean();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(detailCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBannerList_001() {
		Logger.start(true,"验证商品id");
		try {
			Logger.comment("前置条件准备");
			
			detailBean.setProductId("");
			
			detailCall.callService();			
			Logger.comment("activityCall send:" + detailCall.getEntityString());
			Logger.comment("activityCall response:" + detailCall.getReturnData());
			
			Logger.verifyEquals(2, detailCall.getDetailInfo().get("id"), "验证商品id是否正确");		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}
